Add copy-as-HAR buttons for captured requests - #38
Merged
Conversation
Getting a captured request out of the browser meant using the section-level headers and body copy links and retyping the method, path and query string by hand. Add a per-card "Copy request" button and a page-level "Copy all (N)" that put the whole request on the clipboard as a HAR-shaped JSON document. Entries follow HAR 1.2 field names and shapes so the output is familiar to HAR tooling, but carry only a request: httphq never observes a response, so response, timings and cache are omitted rather than emitted as stubs that would read as captured data. The global button copies the visible requests, so the method filter and search box double as a way to scope the export; the count in its label makes that scope visible. Claude-Session: https://claude.ai/code/session_01LXy9D2BfSUqqj7BjPWs3fv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds two clipboard actions on the endpoint screen:
Both put a HAR-shaped JSON document on the clipboard containing everything about the request: method, URL, headers, query string and body. Same envelope either way, so consumers parse one shape regardless of which button was used.
{ "creator": { "name": "httphq", "version": "1" }, "entries": [ { "id": "0625b960-0143-4163-99cb-72484269ab09", "startedDateTime": "2026-08-08T08:55:00.809Z", "clientIPAddress": "127.0.0.1", "request": { "method": "GET", "url": "http://localhost:8080/to/demo-har-panel?utm_source=newsletter&plan=pro", "httpVersion": "HTTP/1.1", "headers": [{ "name": "X-Api-Key", "value": "sk_test_123" }], "queryString": [{ "name": "utm_source", "value": "newsletter" }], "bodySize": 0 } } ] }Notes
response,timingsandcacheare omitted rather than emitted as stubs that would read as captured data.visibleRequests, so the method filter and search box double as a way to scope the export. The count in the label makes that scope visible; it's disabled at zero.Two properties worth knowing, both commented in
public/har.js:httpVersionis hardcoded toHTTP/1.1; the capture handler never records the protocol. Capturing it for real would need a new column ondatabase.Request— separate change if it's wanted.encoding/jsonsorts keys on marshal.Testing
go test ./...passes (unaffected — no Go changes).Copied!feedback, copy-all ordering (newest first), filter scoping, and the disabled-when-empty state.🤖 Generated with Claude Code
https://claude.ai/code/session_01LXy9D2BfSUqqj7BjPWs3fv